from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.support.select import Select
from time import  sleep
# 创建浏览器驱动对象
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Chrome()
# 加载web页面
driver.get("http://121.43.169.97:8848/pageA.html")

# 需求：打开注册A.html页面，完成以下操作：
# 1).点击 alert 按钮
driver.find_element_by_css_selector("#alerta").click()
# 2).关闭警告框
# 3).输入用户名：admin
driver.find_element_by_css_selector("#userA").send_keys("admin")



sleep(3)
driver.quit()